package com.sky.controller.user;


import com.sky.result.Result;
import com.sky.service.ReportService;
import com.sky.vo.ViolationReportVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;


@RestController("userReportController")
@RequestMapping("/user/report")
@Slf4j
@Api(tags = "用户数据统计相关接口")
public class ReportController {
    @Autowired
    private ReportService reportService;
    /**
     * 个人的违法记录统计
     *
     */
    @GetMapping("/violationStatistics")
    @RequiresPermissions("普通用户")
    @ApiOperation("个人的违法记录统计")
    public Result<ViolationReportVO> violationStatistics() {
        log.info("违法记录数据统计");
        ViolationReportVO data = reportService.getmyViolationStatistics();
        return Result.success(data);
    }
    /**
     * 待处理申诉
     *
     */
    @GetMapping("/waitingAppeal")
    @RequiresPermissions("普通用户")
    @ApiOperation("待处理申诉")
    public Result<ViolationReportVO> violationPie() {
        log.info("待处理申诉");
        ViolationReportVO data = reportService.getWaitingAppeal();
        return Result.success(data);
    }
}
